<%@page contentType="application/vnd.ms-excel;charset=UTF-8" %>
<%@ page language="java" import="com.base.myproject.client.jdbc.*" %>
<%@ page language="java" import="com.base.myproject.server.*" %>
<%@ page language="java" import="com.base.myproject.client.jdbc.DataSet" %>
<%@ page language="java" import="com.base.myproject.server.tools.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<%
	String sql = request.getParameter("sql");
	String action = request.getParameter("action");
	String name = action.equals("1") ? "工资" : "报销";
	String xlsName = action.equals("1") ? "help" : "reimbursement";
	response.setHeader("Content-disposition","attachment; filename=" + xlsName + ".xls");
	DataSetTool DST = new DataSetTool();
	DataSet result = DST.getDataSet(sql);
%>
</head>
<body>
	<table style="border-collapse: collapse" cellspacing="0" cellpadding="0" border="1"  bordercolordark="#CCCCCC" bordercolorlight="#CCCCCC" style="line-height: 120%;border-color:#000000;">
		<tr bgcolor="#e8e8e0">
			<td>序号</td>
			<td>银行帐号</td>
			<td>人员</td>
			<td>总薪金</td>
			<td>操作</td>
		</tr>
		<%
			for(int i = 0;i < result.getRowCount();i++){
				int j = i + 1;
				String number = String.valueOf(j).length() == 1 ? "00" + j : (String.valueOf(j).length() == 2 ? "0" + j : String.valueOf(j));
		%>
				<tr>
					<td x:str><%= number %></td>
					<td x:str><%=result.getValue(i,"bankcard") %></td>
					<td><%=result.getValue(i,"bname") %></td>
					<td><%= RPTString2Double.string2String(result.getValue(i,"countje")) %></td>
					<td><%= name %></td>
				</tr>
		<%		
			}
		%>
	</table>
</body>
</html>